Skip to content

Expand National Insurance documentation page (#746)#1699

Open
vahid-ahmadi wants to merge 1 commit into
mainfrom
vahid-ahmadi/issue-746-ni-docs
Open

Expand National Insurance documentation page (#746)#1699
vahid-ahmadi wants to merge 1 commit into
mainfrom
vahid-ahmadi/issue-746-ni-docs

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

  • Closes Documentation page for National Insurance #746.
  • The existing page covered Classes 1, 2, and 4, mentioned Class 3 only in passing, and ended in two appendix charts. The 2022 issue asked for a page "similar to the current pages" — this rounds it out so it sits alongside the income-tax and child-benefit pages.
  • Additions:
    • Class 3 (voluntary) row in the modelling table — it's now modelled via ni_class_3.
    • New "How PolicyEngine computes National Insurance liability" section that walks through the per-class variables (ni_class_1_employee, ni_class_1_employer, ni_class_2, ni_class_3, ni_class_4) and explains how they roll up into national_insurance and government revenue.
    • References section linking SSCBA 1992, the HMRC rates page, and HMRC outturn statistics.
  • Drive-by fix: the rates chart cell was doing df[df[\"Threshold\"] == False][df.Value < 1], which produced a pandas "Boolean Series key will be reindexed" UserWarning in the rendered output. Combined into a single boolean mask.

Test plan

  • Notebook still valid JSON.
  • Docs build job renders the new sections cleanly and without the pandas warning.

🤖 Generated with Claude Code

The existing page covered Classes 1, 2 and 4 and ended in two parameter
charts. Round it out with:

- Class 3 (voluntary) added to the modelling table now that ni_class_3
  is exposed,
- a "How PolicyEngine computes National Insurance liability" section that
  walks through the per-class variables and the household total,
- a References block (SSCBA 1992, HMRC rates page, HMRC outturn stats).

Also fix the chained boolean indexing in the rates chart cell, which was
triggering a pandas UserWarning ("Boolean Series key will be reindexed").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation page for National Insurance

1 participant